package com.eascs.web.o2o.web.dao;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.eascs.app.dao.PageResult;
import com.eascs.app.dao.SqlPageQuery;
import com.eascs.web.o2o.web.entity.BankLimit;


@Repository
public class BankLimitDao {
	
	@Autowired	
	BiodsDao biodsDao;

	public PageResult<Object[]> getBankLimitList(Map<String, String> param, int pageSize, int pageIndex) {
		String sql = "SELECT t.id,t.bank_name,t.bank_limit,t.updator_name,t.update_time,t.remark from ods_o2odev_bank_limit t where t.is_delete = 'N'";
		SqlPageQuery<Object[]> sqlPageQuery = new SqlPageQuery<>(Object[].class, pageSize, pageIndex, sql.toString());
		return biodsDao.findDataWithPage(sqlPageQuery);
	}

	public BankLimit getLimitById(String id) {
		String sql = "SELECT * from ods_o2odev_bank_limit t where t.id = ? and t.is_delete='N'";
		return biodsDao.findEntity(sql, BankLimit.class, id);
	}
}
